package com.twu.biblioteca.ui.menus;

import com.twu.biblioteca.library.Library;
import com.twu.biblioteca.ui.menus.items.ExitMenuItem;
import com.twu.biblioteca.ui.menus.items.books.ListBooksMenuItem;
import com.twu.biblioteca.ui.menus.items.books.ReturnBookMenuItem;
import com.twu.biblioteca.ui.menus.items.movies.ListMoviesMenuItem;
import com.twu.biblioteca.ui.menus.items.users.LoginMenuItem;
import com.twu.biblioteca.ui.menus.items.users.ViewUserInformationMenuItem;

/**
 * @author Alvi Jonathan Sait
 */
public class MainMenu extends AbstractMenu {

    public MainMenu(Library library) {
        super(library);
        addMenuItem(new ListBooksMenuItem());
        addMenuItem(new ListMoviesMenuItem());
        addMenuItem(new ReturnBookMenuItem());
        addMenuItem(new LoginMenuItem());
        addMenuItem(new ViewUserInformationMenuItem());
        addMenuItem(new ExitMenuItem());
    }

    @Override
    public String getOutput() {
        StringBuilder builder = new StringBuilder(generateMenuItemsOutput());
        return builder.substring(0, builder.length() - System.lineSeparator().length());
    }

    @Override
    public String getUserPrompt() {
        return "Please select an option:";
    }
}
